-
Notifications
You must be signed in to change notification settings - Fork 140
Fix 'getvalue' AttributeError when test fails during __call__ #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
328cff8 to
8fc1b97
Compare
208b817 to
fd9386f
Compare
|
|
|
|
|
|
|
|
In some sub classes of TestCase where __call__() method is overridden, errors may occur that prevents the super class __call__ being called, e.g. Django's custom TestCase subclasses do pre-setup processing such as loading the fixture etc. which, on encountering exceptions, will skip calling __call__ on the super class, leaving sys.stdout and sys.stderr untouched. In the current implementation, this causes an unhandled AttributeError when trying to call .getvalue() on sys.stdout and sys.stderr. Refs: xmlrunner#83
sys.stdout and sys.sterr may not necessarily be StringIO yet. We should catch AttributeError when trying to call getvalue() on them. Fixes: xmlrunner#83
|
|
Fix 'getvalue' AttributeError when test fails during __call__
|
thank you. |
sys.stdout and sys.sterr may not necessarily be StringIO
yet. We should catch AttributeError when trying to call
getvalue() on them.
Fixes: #83